<?php
if (!defined('BASEPATH'))
	exit('No direct script access allowed');
class Competence_lib {
	function __construct() {
		$this -> CI = &get_instance();
		//log_message('debug', "Login Class Initialized");
	}

	function competence($val, $user) {

		if (!empty($val) AND !empty($user)) {
			
			$user["sercet_level"];
			$user["is_public"];
			$user["important"];
			//echo '<br>';
			$is_public = $val -> is_public;
			$important = $val -> important;
			$sercet_level = $val -> sercet_level;

			$is_look_ok = false;

			if (		($user["important"] >= $important) 
				AND ($user["sercet_level"] >= $sercet_level) 
				AND ($user["is_public"] >= $is_public)
				) {
				$is_look_ok = true;
			}

			if ($user["users_id"] == $val -> broker) {
				$is_look_ok = true;
			}

			return $is_look_ok;
		}

	}

}
